from typing import Optional
from pydantic import BaseModel


class GetTokenResponse(BaseModel):
    accessToken: str
    accessTokenExpiredInMinute: int
    refreshToken: str
    refreshTokenInMinute: int
    result: str


class GetTokenRequest(BaseModel):
    appId: str
    signed: str
    timestamp: int


class RefreshTokenRequest(BaseModel):
    appId: str
    refreshToken: str


class RefreshTokenResponse(BaseModel):
    accessToken: str
    accessTokenExpiredInMinute: int
    result: str


class AuthBaseInfo(BaseModel):
    appId: str
    appName: str
    appSecret: str
    source: int


class RegisterAppRequest(BaseModel):
    appId: str
    signed: str
    timestamp: int
    userId: str
    userPass: str


class RegisterAppResponse(BaseModel):
    result: str


class LoginAppRequest(BaseModel):
    appId: str
    userId: str
    userPass: str


class LoginAppResponse(BaseModel):
    token: str
    accessTokenExpiredInMinute: int
    result: str


class LogoutAppRequest(BaseModel):
    accessToken: str
    userId: str
    appId: str


class LogoutAppResponse(BaseModel):
    result: str


class UnregisterAppRequest(BaseModel):
    appId: str
    userId: str
    userPass: str


class UnregisterAppResponse(BaseModel):
    result: str


class InvalidateTokenRequest(BaseModel):
    appId: str
    signed: str
    timestamp: int


class InvalidateTokenResponse(BaseModel):
    result: str
